package cn.com.lyj6851;

import cn.com.lyj6851.utils.SpringContextHolder;
import com.binarywang.spring.starter.wxjava.miniapp.config.WxMaAutoConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 后台管理
 * @author Lang YongJun
 * @date 2020/10/21
 */

@RestController
@EnableTransactionManagement
@SpringBootApplication(exclude = {WxMaAutoConfiguration.class})
//cn.com.lyj6851.modules.monitor.service.mapper
@MapperScan(basePackages ={"cn.com.lyj6851.modules.*.service.mapper","cn.com.lyj6851.config"})
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class,args);
    }

    @Bean
    public SpringContextHolder springContextHolder() {
        return new SpringContextHolder();
    }

    /**
     * 访问首页提示
     * @return /
     */
    @GetMapping("/test")
    public String index() {
        return "Backend service started successfully5";
    }
}